//
//  MYGMeetScheduleCollectionViewCell.swift
//  MYDoctor
//
//  Created by Denny on 2024/5/28.
//

import UIKit

class MYGMeetScheduleCollectionViewCell: UICollectionViewCell {
      
    var model:MYGScheduleCellModel?{
        didSet {
            guard let item = model else {return}
            if item.time.isEmpty {
                contentLabel.text = item.titel
                timeLabel.isHidden = true
                bkView.backgroundColor = .rgba(10, 53, 167, 1)
                contentLabel.textColor = .white
                contentLabel.font = .medium(13)
                contentLabel.snp.updateConstraints { make in
                    make.centerY.equalToSuperview()
                }
            }else {
                timeLabel.isHidden = false
                timeLabel.text = item.time
                contentLabel.text = item.titel
                bkView.backgroundColor = .rgba(249, 250, 255)
                contentLabel.textColor = .rgba(10, 53, 167, 1)
                contentLabel.font = .regular(10)
                contentLabel.snp.updateConstraints { make in
                    make.centerY.equalToSuperview().offset(20)
                }
            }
         
        }
    }
     
    @IBOutlet weak var bkView: UIView!
    
    @IBOutlet weak var timeLabel: UILabel!
    
    @IBOutlet weak var contentLabel: UILabel!
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
        layer.cornerRadius = 5
        layer.borderWidth = 0.5
        layer.borderColor = UIColor.rgba(27, 79, 218, 1).cgColor
        clipsToBounds = true
    }

}
